#!/bin/sh
## date: 2019/07/12
## desc: start alertmanager of docker

echo "10.11.100.17 mongo.zhenai.com" >> /etc/hosts

# cluster mode in docker
/alertmanager/bin/alertmanager --web.listen-address="0.0.0.0:9093" --cluster.listen-address="0.0.0.0:9094" --cluster.peer="10.11.100.79:9094" --config.file=/alertmanager/cfg/alertmanager.yml --storage.path=/alertmanager/data &>/alertmanager/log/alertmanager.log 

# cluster mode no docker
#./bin/alertmanager --web.listen-address="0.0.0.0:9093" --cluster.listen-address="0.0.0.0:9094" --cluster.peer="10.11.100.79:9096" --config.file=./cfg/alertmanager.yml --storage.path=./data &>./log/alertmanager.log 
#./bin/alertmanager --web.listen-address="0.0.0.0:9095" --cluster.listen-address="0.0.0.0:9096" --cluster.peer="10.11.100.79:9094" --config.file=./cfg/alertmanager.yml --storage.path=./data &>./log/alertmanager.log 

# not cluster mode
# /alertmanager/bin/alertmanager  --config.file=/alertmanager/cfg/alertmanager.yml --storage.path=/alertmanager/data &>/alertmanager/log/alertmanager.log 

# 校验文件
# amtool --alertmanager.url=http://127.0.0.1:9093 check-config ./cfg/alertmanager.yml

# 重载配置
# sudo curl -XPOST  http://127.0.0.1:9093/-/reload
